# name : Place all dataset var names in macro variable
# key : place.all.varname.in macrovar
# contributor: Shuguang Sun
# --
%macro lst(dsn);
  %local dsid cnt rc;
  %global x;
  %let x=;
  %let dsid=%sysfunc(open(&dsn));
  %if &dsid ne 0 %then %do;
    %let cnt=%sysfunc(attrn(&dsid, nvars));

    %do i = 1 %to &cnt;
      %let x=&x %sysfunc(varname(&dsid, &i));
      %end;

    %end;
    %else %put &dsn cannot be open.;
  %let rc=%sysfunc(close(&dsid));

%mend lst;
